package com.wn.budget.repository;

import com.wn.budget.model.ProjectMaterial;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author lin yue bin
 * @version 1.0
 * @date 2019/10/19 22:32
 */
public interface ProjectMaterialRepository extends JpaRepository<ProjectMaterial, String> {
    Page<ProjectMaterial> findByProjectIdAndProjectSpaceId(String projectId, String projectSpaceId, Pageable pageable);

    Long countByProjectIdAndProjectSpaceIdAndMaterialId(String projectId, String projectSpaceId, String materialId);

    List<ProjectMaterial> findByProjectId(String projectId);
}
